<!DOCTYPE html>
<html>
<head>
    <script src="/assets/jquery/jquery-3.1.1.min.js"></script>
    <script src="/assets/layui-2.9.18/layui.js"></script>
    <link rel="stylesheet" href="/assets/layui-2.9.18/css/layui.css">
    <link rel="stylesheet" href="/assets/layui-2.9.18/css/admin.css">
    <script src="/assets/september/common.js"></script>
    <script src="/assets/september/htmlBuilder.js"></script>
    <script src="/assets/september/search.js"></script>
    <link rel="stylesheet" href="/assets/pages/list.css">
    <link rel="stylesheet" href="/assets/pages/form.css?1">
</head>
<body>
<div class="layui-form" style="padding: 20px 20px 0 20px;">
    <form id="form" class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">节目名称</label>
            <div class="layui-input-inline">
                <input type="text" name="flashName" value="${flash.flashName!}" class="layui-input" lay-verify="required"/>
                <input type="hidden" name="id" value="${flash.id!}" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">显示时长(秒)</label>
            <div class="layui-input-inline">
                <input type="number" name="waitTime" value="${flash.waitTime!}" class="layui-input" lay-verify="required"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">起始x</label>
            <div class="layui-input-inline">
                <input type="number" name="x"  value="${flash.x!}"  class="layui-input" lay-verify="required"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">起始y</label>
            <div class="layui-input-inline">
                <input type="number" name="y" value="${flash.y!}"  class="layui-input" lay-verify="required"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">宽w</label>
            <div class="layui-input-inline">
                <input type="number" name="w"  value="${flash.w!}" class="layui-input" lay-verify="required"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">高h</label>
            <div class="layui-input-inline">
                <input type="number" name="h" value="${flash.h!}"  class="layui-input" lay-verify="required"/>
            </div>
        </div>
    </form>
    <div class="layer-footer" style="float:right;margin-bottom:10px;">
        <input class="layui-btn layui-btn-normal wid-200px" style="right: 50px" lay-submit lay-filter="submit_button"
               value="保存">
    </div>
</div>


<script>
    layui.config({
        base: '../../../assets/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'table'], function () {
        let form = layui.form;
        form.on("submit", function (data) {
            console.log(data)
            layer.confirm("确定保存吗？", function () {
                sajax({
                    url: "/led/doEditFlash",
                    type: "post",
                    data: data.field,
                    dataType: 'json',
                    success: function (res) {
                        layer.msg('保存成功', {shade: [0.1, '#fff'], time: 1600});
                        closeWindowAndRefreshParent();
                    }
                })
            });
        });

    });

</script>

</body>
</html>
